﻿using Org.BouncyCastle.Asn1.X509.SigI;
using System;
using System.Collections.Generic;
using System.Net.WebSockets;

namespace FRMS.Model
{
    public class SocketInfo
    {
    }
    public class QueryInfo
    {
        public string method { get; set; }
        public int req_id { get; set; }
    }

    public class QueryInfoReturn
    {
        public string method { get; set; }
        public List<QueryInfoReturnData> data { get; set; }
        public int req_id { get; set; }
    }

    public class QueryInfoReturnData
    {
        public int stateIntervalTime { get; set; }
        public string deviceID { get; set; }
        public string deviceIP { get; set; }
        public string devDateTime { get; set; }
        public int deviceState { get; set; }
        public int errNo { get; set; }
        public int liftMode { get; set; }
        public int eventReportEnabled { get; set; }
        public int devRestart { get; set; }
    }

    public class ParameterInfo
    {
        public string method { get; set; }
        public List<ParameterInfoData> data { get; set; }
        public int req_id { get; set; }
    }
    public class ParameterInfoData
    {
        public string deviceID { get; set; }
        public int liftMode { get; set; }
        public int eventReportEnabled { get; set; }
        public int stateIntervalTime { get; set; }
        public int devRestart { get; set; }
        public string devDateTime { get; set; }
    }

    public class SavePersonInfo
    {
        public string method { get; set; }
        public SavePersonData data { get; set; }

        public int req_id { get; set; }
    }
    public class SavePersonData
    {
        public List<SavePersonInfoData> personInfos { get; set; }
        public List<SavePersonDeviceData> deviceInfos { get; set; }

    }
    public class SavePersonDeviceData
    {
        public string deviceID { get; set; }
        public string deviceName { get; set; }
    }

    public class SavePersonInfoData
    {
        public string personID { get; set; }
        public int personType { get; set; }
        public string personName { get; set; }
        public int sex { get; set; }
        public string cardNo { get; set; }
        public string personPhoto { get; set; }
        public string frontFloor { get; set; }
        public string backFloor { get; set; }
        public string startTime { get; set; }
        public string endTime { get; set; }
    }

    public class DeletePersonInfo
    {
        public string method { get; set; }
        public DeletePersonData data { get; set; }

        public int req_id { get; set; }
    }

    public class DeletePersonData
    {
        public List<DeletePersonInfoData> personInfos { get; set; }
        public List<SavePersonDeviceData> deviceInfos { get; set; }
    }

    public class DeletePersonInfoData
    {
        public string personID { get; set; }
    }

    public class DevStateUpdate
    {
        public string method { get; set; }
        public List<DevStateUpdateData> data { get; set; }

        public int req_id { get; set; }
    }

    public class DevStateUpdateData
    {
        public string deviceID { get; set; }
        public string deviceIP { get; set; }

        public string deviceState { get; set; }
    }

    public class DevStateUpdateReturn
    {
        public string method { get; set; }
        public int code { get; set; }

        public string msg { get; set; }
        public int req_id { get; set; }
    }

    public class ClearPersonInfo
    {
        public string method { get; set; }
        public List<SavePersonDeviceData> data { get; set; }

        public int req_id { get; set; }
    }


    public class SavePersonReturn
    {
        public string method { get; set; }
        public List<SavePersonReturnData> data { get; set; }
        public int req_id { get; set; }
        public int code { get; set; }
        public string msg { get; set; }
    }

    public class SavePersonReturnData
    {
        public string deviceID { get; set; }
        public string personID { get; set; }
        public string deviceName { get; set; }
        public int errNo { get; set; }
    }

    public class ClearPersonReturn
    {
        public string method { get; set; }
        public List<ClearPersonReturnData> data { get; set; }
        public int req_id { get; set; }
        public int code { get; set; }
        public string msg { get; set; }
    }

    public class ClearPersonReturnData
    {
        public string deviceID { get; set; }
        public string deviceName { get; set; }
        public int errNo { get; set; }
    }

    public class devState
    {
        public string method { get; set; }
        public List<DeviceStateInfo> data { get; set; }
        public int req_id { get; set; }
    }

    public class DeviceStateInfo
    {
        public string deviceID { get; set; }
        public string deviceIP { get; set; }
        public string deviceName { get; set; }
        public int deviceState { get; set; }
        public DateTime time { get; set; } = DateTime.Now;
    }

    public class ClientSocketInfo
    {
        public string ClientIP { get; set; }
        public string State { get; set; }
        public string ConnectTime { get; set; }
    }
}
